package com.zjw.shortlink.project.controller;

import com.zjw.shortlink.project.common.convention.result.Result;
import com.zjw.shortlink.project.common.convention.result.Results;
import com.zjw.shortlink.project.dto.req.RecycleBinRecoverReqDTO;
import com.zjw.shortlink.project.dto.req.RecycleBinRemoveReqDTO;
import com.zjw.shortlink.project.dto.req.RecycleBinSaveReqDTO;
import com.zjw.shortlink.project.service.RecycleBinService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RestController
public class RecycleBinController {
    private final RecycleBinService recycleBinService;

    @PostMapping("/api/short-link/v1/recycle-bin/save")
    public Result<Void> saveRecycleBin(@RequestBody RecycleBinSaveReqDTO requestParams) {
        recycleBinService.saveRecycleBin(requestParams);
        return Results.success();
    }

    @PostMapping("/api/short-link/v1/recycle-bin/recover")
    public Result<Void> recoverRecycleBin(@RequestBody RecycleBinRecoverReqDTO requestParams) {
        recycleBinService.recoverRecycleBin(requestParams);
        return Results.success();
    }

    @PostMapping("/api/short-link/v1/recycle-bin/remove")
    public Result<Void> removeRecycleBin(@RequestBody RecycleBinRemoveReqDTO requestParams) {
        recycleBinService.removeRecycleBin(requestParams);
        return Results.success();
    }
}
